﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Page/Site.Master" AutoEventWireup="true" CodeBehind="nhat-ky-dieu-dong.aspx.cs" EnableEventValidation="false" Inherits="VanTaiTMS.Page.nhat_ky_dieu_dong" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<!---Check-all----->
<script type="text/javascript">
    function checkAll(checkId) {
        $('.bordered tbody input').each(function () {
            if ($('input#chkAll').is(":checked")) {
                $(this).attr({ 'checked': 'checked' });
                $(this).parent().parent().css({ 'background': 'rgb(208, 233, 198)' });
            } else {
                $(this).attr({ 'checked': false });
                $(this).parent().parent().css({ 'background': '#ffffff' });
            }
        })
    }
</script>
<!-------End------->

<!---AutoComplete-->
<script type="text/javascript">
    function pageLoad(sender, args) {
        $(document).ready((function () {
            var availableTags1 = [ <%= SuggestionList %>];

            $("#<%= txtSearch.ClientID %>").autocomplete({
                source: availableTags1
            });
        }));

        $(function () {
            $(".textboxngaynhap").datepicker({
                showOn: "button",
                buttonImage: "../images/calendar.gif",
                dateFormat: 'dd/mm/yy',
                changeMonth: true,
                changeYear: true,
                buttonImageOnly: true
            }).val();
        });


        $(function () {
            $(".textboxfillter").datepicker({
                showOn: "button",
                buttonImage: "../images/calendar.gif",
                dateFormat: 'dd/mm/yy',
                changeMonth: true,
                changeYear: true,
                buttonImageOnly: true
            }).val();
        });

        $(function ($) {
            $(".textboxngaynhap").mask("99/99/9999"); //Kiem tra ngay nhap
            $(".textboxsodienthoai").mask("(9999) 999-999");//Kiem tra so dien thoai
            $(".textboxsodienthoai11").mask("(99999) 999-999");//Kiem tra so dien thoai
        });

        //Check Row Hender Color
        $(document).ready(function () {
            $('.adminlist1 tr').click(function (event) {
                if (event.target.type !== 'checkbox') {
                    $(':checkbox', this).trigger('click');
                }
            });

            $("input[type='checkbox']").change(function (e) {
                if ($(this).is(":checked")) {
                    $(this).closest('tr').css("background", "Wheat");
                } else {
                    $(this).closest('tr').css("background", "");
                }
            });
        });
    }
</script>
<!-------End------->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:UpdatePanel ID="upDatePanelAll" runat="server">
   <ContentTemplate>
       <div id="toolbar-2" class="yui3-toolbar">
            <div id="toolbar-1" class="yui3-toolbar">
            <asp:Panel id="panel1" runat="server" DefaultButton="cmdSerach">
                <div class="div-search-texbox">
                    <asp:TextBox ID="txtSearch" placeholder="Nhập vào từ khoá tìm kiếm..." CssClass="textbox_child_Search" runat="server"></asp:TextBox>      
                </div>

                <div class="div-search">
                    <asp:Button ID="cmdSerach" runat="server" CssClass="btn-add-search" Text="" OnClick="cmdSerach_Click" />
                    <asp:Button ID="cmdRefesh" runat="server" CssClass="btn-add-refesh"  Text="" onclick="cmdRefesh_Click" />
               </div>
            </asp:Panel>
            <div class="clr"></div>
        </div> 

            <asp:Panel id="panel2" runat="server" DefaultButton="cmdFilter" >
                <div class="div-search-texbox-date-fillter">
                    <asp:TextBox ID="txtTuNgayNgayNhapKho" placeholder="Từ ngày" CssClass="textboxngaynhap" Width="150px" runat="server"></asp:TextBox>
                    <asp:TextBox ID="txtDenNgayNhapKho" placeholder="Đến ngày ngày" CssClass="textboxngaynhap" Width="150px" runat="server"></asp:TextBox>
                </div>

                <div class="div-search_B">
                    <asp:Button ID="cmdFilter" CssClass="btn-add-fillter" runat="server" ToolTip="Lọc" OnClick="cmdFilter_Click" />
                </div>
            </asp:Panel>
        <div class="clr"></div>    
        </div>

       <%=StrAlert%>

       <!-----------Hiễn-Thị-Dữ-Liệu------------>
       <table  class="bordered">
           <thead>
                <tr>
                    <th width="5%">STT</th>        
                    <th width="5%">
                        <input type="checkbox" onclick="checkAll('chkList');" id="chkAll">
                    </th>
                    <th width="10%">Mã điều động</th>
                    <th width="10%">Ngày điều động</th>
                    <th width="5%">Số xe</th>
                    <th width="15%">Tài xế</th>
                    <th width="15%">Nhóm xe</th>
                    <th width="10%">Loại xe</th>
                    <th width="15%">Trạng thái</th>
                </tr>
           </thead>

           <tbody>
             <asp:ListView ID="ListViewAll" runat="server" ItemPlaceholderID="lstViewAll" DataKeyNames="DommandTransferOrder_ID" OnItemCommand="ListViewAll_ItemCommand" OnItemDataBound="ListViewAll_ItemDataBound">
                <ItemTemplate>
                    <tr>
                        <td align="center" style="text-align:center">
                            <asp:Label ID="lb_lst_ID" runat="server" Text='<%# Eval("DommandTransferOrder_ID") %>'></asp:Label>
                        </td>

                        <td style="text-align:center">
                            <asp:CheckBox ID="chkList" onclick='highlight(this)' ClientIDMode="Static" runat="server" />
                        </td>

                        <td style="text-align:center">
                            <asp:Label ID="lbMa" runat="server" Text='<%# Eval("DommandTransferOrder_Alias") %>'></asp:Label>
                            <input type="hidden" id="hiddenId" value='<%# Eval("DommandTransferOrder_ID") %>' runat="server" name="hiddenId" />
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName" CommandName="Accept" runat="server"><%# Eval("DommandTransferOrder_Date","{0:dd/MM/yyyy}")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName_A" CommandName="Accept" runat="server"><%# Eval("Vehicle_Number")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName_B" CommandName="Accept" runat="server"><%# Eval("FullNameMem")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName_C" CommandName="Accept" runat="server"><%# Eval("VehicleGroup_Name_Old")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName_D" CommandName="Accept" runat="server"><%# Eval("Type_Vehicle_Name")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="link_stt" CommandName="Accept" runat="server" Text='<%# Eval("DommandTransferOrder_Stt")%>'></asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <asp:PlaceHolder runat="server" ID="lstViewAll"></asp:PlaceHolder>
                </LayoutTemplate>
             </asp:ListView>
        </tbody>
       </table>
       <!--------------Kêt-thúc----------------->

       <!-------------Phân-trang---------------->
       <table  class="bordered">
            <thead>
                <tr>
                    <th class="pager">
                        <asp:DataPager ID="DataPagerListAll" runat="server" 
                            OnPreRender="DataPagerListAll_PreRender" PagedControlID="ListViewAll">
                            <Fields>
                                <asp:NextPreviousPagerField FirstPageText="&lt;&lt;" PreviousPageText="&lt;" 
                                    ShowFirstPageButton="True" ShowNextPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField LastPageText="&gt;&gt;" NextPageText="&gt;" 
                                    ShowLastPageButton="True" ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </th>
                </tr>
            </thead>
        </table>
       <!--------------Kêt-thúc----------------->
   </ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
